package mysql

import (
	"fmt"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var (
	err error
	Db  *gorm.DB
)

func InitMysql() {
	dsn := "root:123456@tcp(60.204.218.87:3306)/zk1?charset=utf8mb4&parseTime=True&loc=Local"
	Db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil {
		panic(err)
	}
	fmt.Println("mysql 连接成功")
}
